
Softwares required for replicate this paper: R (version 4.0.3, 2020-10-10) and STATA (16)

Before running any code, make sure the following files are in your computer repository:
    data_wpm.csv
    data_wpm2.csv
    data_censo_10.csv
    religion_labels_censo.csv
    homicides_rates.csv
    nomes_munic.csv
    high_educ.csv
    ideology.dta
    data_pref_educ_right.csv
    data_pastor.dta
    data_vereador.dta
    women_elected.dta 



FIRST STEP: open the file "Araújo_Gatto_CPS_code_replication.R" (written in R) to replicate the Figure 1 (main text)
             ** Run the lines 13-42 to generate the figure.


SECOND STEP: using the file "Araújo_Gatto_CPS_code_replication.R" (written in R), run the lines 63-229 to create the dataset (munic_analysis.dta) 
           used in the paper to run all the municipal-level estimates

  
After running all lines of this code, the expected outcome would be the file "munic_analysis.dta. Save this dataset in your repository and then go to the third step. 


THIRD STEP: open the file "Araújo_Gatto_code_municipal_level.do" (written in STATA)
      This code will be used to open the file "munic_analysis.dta". By using this code you will be able to replicate all the municipal-level estimates 
      reported in the paper (Main text + Appendix)


FOURTH STEP: open the file "Araújo_Gatto_code_individual_level.do" (written in STATA)
       This code will be used to open the file "data_datafolha.csv". By using this code you will be able to replicate the data preparation for run the estimates,
        and all the individual-level estimates reported in the paper (Main text + Appendix)



 






         




  


